<div class="menu">
	<h2><?php echo $this->escape($this->TreeTitle);?></h2>
<?php

function ShowTree($tree, $pid=0)
{
	echo '<ul type="square">';
	foreach ($tree as $id=>$root)
	{
		if ($pid!=$id)
			continue;
		if (count($root))
		{
			foreach ($root as $key => $item)
			{
				$leaf = !(array_key_exists($key, $tree) && count($tree[$key]));
				echo '<li><a href="'.(!$leaf?'#':$item['url']).'">'.$item['anchor'].'</a>';
				if (!$leaf)
					ShowTree($tree,$key);
				echo '</li>';
			}
		}
	}
	echo '</ul>';
}

ShowTree($this->TreeCategories);

?>
</div>